package com.scommunity.admin.controller;

import com.scommunity.admin.vo.RolePermVO;
import com.scommunity.common.ResponseResult;
import com.scommunity.domain.Perm;
import com.scommunity.service.IPermService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/admin/perm")
public class PermController {
    @Autowired
    private IPermService permService;

    @GetMapping("/getAll")
    public Object getAll() {
        List<Perm> perms = permService.getAll();
        return ResponseResult.success(perms);
    }

    @PostMapping("/update")
    public Object update(@RequestBody RolePermVO rolePermVO) {
        permService.update(rolePermVO);
        return ResponseResult.success();
    }

}
